from flask import Flask,request
import json
app=Flask(__name__)
@app.route('/',methods=['POST'])
def login():
    if request.method == 'POST':
        # 判断请求方式是否合法
        data=json.dumps({
        "username":request.form.get("username"),
        "password":request.form.get("password"),
        # 从请求中获取username和password对应的值并显示
        "status_code":"222",
        "message":"Post接口请求成功",
        "info":"test info ....."},ensure_ascii=False)
    else:
        data=json.dumps({
            "message":"invalid parament"
        })
    return data
if __name__ == '__main__':
    app.run()